package com.yuedou.api.service.product.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yuedou.api.dao.product.ProductAttrRelationshipMapper;
import com.yuedou.api.entity.product.ProductAttrRelationship;
import com.yuedou.api.service.base.impl.BaseServiceImpl;
import com.yuedou.api.service.product.ProductAttrRelationshipService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class ProductAttrRelationShipServiceImpl extends BaseServiceImpl<ProductAttrRelationshipMapper, ProductAttrRelationship> implements ProductAttrRelationshipService {

    @Resource
    private ProductAttrRelationshipMapper relationshipDao;

    @Override
    public List<ProductAttrRelationship> getListByPid(int product_id,int attr_name_id) {
        QueryWrapper qw = new QueryWrapper();
        qw.eq("product_id",product_id);
        qw.eq("attr_name_id",attr_name_id);
        return relationshipDao.selectList(qw);
    }
}
